package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.LitemallBannerMapper;
import org.linlinjava.litemall.db.domain.LitemallBanner;
import org.linlinjava.litemall.db.domain.LitemallBannerExample;
import org.linlinjava.litemall.db.domain.LitemallBrandExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LitemallBannerService {
    @Resource
    private LitemallBannerMapper bannerMapper;

    public List<LitemallBanner> querryAllBanner(){
        LitemallBannerExample example = new LitemallBannerExample();
        example.or().andLogicalDeleted(true);
        return bannerMapper.selectByExample(example);
    }

    public void add(LitemallBanner litemallBanner) {
        bannerMapper.insertSelective(litemallBanner);
    }

    public void update(LitemallBanner litemallBanner) {
        bannerMapper.updateByPrimaryKeySelective(litemallBanner);
    }

    public void delete(Integer id) {
        bannerMapper.logicalDeleteByPrimaryKey(id);
    }
}
